package com.domain;

import java.util.ArrayList;

import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

import com.google.appengine.api.datastore.Key;

@PersistenceCapable
public class GPSLog {
	@PrimaryKey
	@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
	private Key primaryKey;
	
	@Persistent
	private ArrayList<GPSLogEntry> entryLog;
	
	@Persistent
	private AppUser appUser;
	
	public GPSLog(AppUser appUser){
		this.appUser = appUser;
		this.entryLog = new ArrayList<GPSLogEntry>();
	}
	
	public void addEntry(GPSLogEntry entry){
		entryLog.add(entry);
	}
	
	public ArrayList<GPSLogEntry> getEntryLog(){
		return entryLog;
	}

	public Key getPrimaryKey() {
		return primaryKey;
	}

	public void setPrimaryKey(Key primaryKey) {
		this.primaryKey = primaryKey;
	}

	public AppUser getAppUser() {
		return appUser;
	}

	public void setAppUser(AppUser appUser) {
		this.appUser = appUser;
	}
}
